import gamestate
import pygame

class ConfirmToMenu(gamestate.GameState):
    """GameState for confirming backing out of game to menu"""
    
    def __init__(self):
        #basic keybinds
        self.keybinds = {'to_menu': pygame.K_RETURN,
                         'to_pause': pygame.K_ESCAPE}
        
        #link actions to appropriate function references
        self._actions = {'to_menu': self._action_to_menu,
                         'to_pause': self._action_to_pause}
        
        self._newState = self
            
    def enter_state(self):
        self._newState = self
    
    def update(self, etime):
        return self._newState
    
    def _action_to_menu(self):
        self._newState = gamestate.GameState.validStates['mainmenu']
        
    def _action_to_pause(self):
        self._newState = gamestate.GameState.validStates['paused']